<template>
	<view>
		<web-view ref="view" src="/hybrid/html/local_choose_point.html" @message="getMessage" @onPostMessage="onPostMessage">
		</web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				line: null,
				lineStr: '',
				currentWebview: null
			}
		},
		onLoad(option) {
			this.lineStr = option.json;
			this.line = JSON.parse(option.json)
		},
		methods: {
			getMessage(e) {
				if (e.detail.data[0].action === 'init') {
					try {
						const currentWebview = this.$scope.$getAppWebview();
						currentWebview.children()[0].evalJS('doMap(\'' + this.lineStr + '\')')
					} catch (e) {
						console.log(e)
					}
				}
			},
			onPostMessage(e) {
				console.log(e.detail.data)
			},
		}
	}
</script>

<style>

</style>
